import type * as type from "./type"
import { request } from "@/http/axios"

// 企业参数设置 - 获取详情
export function getEnterpriseParams(): Promise<type.EnterpriseParamsResponse> {
  return request({
    url: "/enterprise/params",
    method: "get"
  })
}

// 企业参数设置 - 提交
export function saveEnterpriseParams(
  data: type.SaveEnterpriseParamsRequest
): Promise<type.EnterpriseParamsResponse> {
  return request({
    url: "/enterprise/params",
    method: "post",
    data
  })
}

// 通用文件上传
export function uploadFile(
  data: type.UploadFileRequest
): Promise<type.UploadFileResponse> {
  return request({
    url: "/file/upload",
    method: "post",
    data,
    headers: { "Content-Type": "multipart/form-data" }
  })
}
